home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tcoop.arc / TCOOP2.ARC / WSOTXSCR.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-26  |  1.2 KB  |  43 lines

  1. // wsotxscr.cpp: Text-based windows startup code
  2.  
  3. #include "wsotxscr.h"
  4.  
  5. Wso *FullScrn;
  6. MsgPkt StartMsg;
  7.  
  8. void Setup(MouseOpt Mo, ColorPak &Cp)
  9. // Sets up the text screen environment by initializing the mouse
  10. // and creating a the FullScrn object to reference the text
  11. // screen.  The FullScrn object can serve as the base for other
  12. // window objects. 
  13. {
  14.   FullScrn = new Wso(0x00, 0x00, Cp); // Initialize without a border 
  15.   StartMsg = NullMsg;
  16.   if (Mo != NoMouse) {
  17.      Mouse.Setup(TextScrn);
  18.      if ((!Mouse.SetupOK()) && (Mo == MouseRequired)) {
  19.         FullScrn->Panel->Clear(' ', 0);
  20.         FullScrn->Panel->HzWrtB(0, 0, "Unable to initialize mouse."); 
  21.         exit(1);
  22.      }
  23.   }
  24. }
  25.  
  26. void MainEventLoop(void)
  27. // Starts up the main event loop by calling the FullScrn object's
  28. //  EventLoop method. But first, set the focus to the top Iso. 
  29. {
  30.   if (FullScrn->SubMgr->Top != NULL)
  31.      FullScrn->SubMgr->Top->SwitchFocus(StartMsg);
  32.   FullScrn->SubMgr->EventLoop(StartMsg);
  33. }
  34.  
  35. void CleanUp(void)
  36. // Shuts down the text screen environment by de-allocating the
  37. // FullScrn and turning off the mouse 
  38. {
  39.   delete FullScrn;
  40.   Mouse.TurnOff(); // Do this AFTER deleting FullScrn!
  41. }
  42.  
  43.